package com.aat.dxfy.concurrent.demo3;

import java.util.concurrent.BlockingQueue;

public class Consumer implements Runnable{  
  
    protected BlockingQueue<Object> queue = null;  
  
    public Consumer(BlockingQueue<Object> queue) {  
        this.queue = queue;  
    }  
  
    public void run() {  
        try {  
            while(queue.size()>0){
            	System.out.println(queue.take());  
                System.out.println(queue.take());  
                System.out.println(queue.take()); 
            }
        } catch (InterruptedException e) {  
            e.printStackTrace();  
        }  
    }  
}  